using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Apache.NMS;

namespace SimpleServiceBus.Endpoints.ActiveMQ.Transport {

    public class ActiveMQConsumedQueue {

        //-----< Fields >-----
        //----------------------------------------------------------------------------------        
        private String fName;


        //-----< Constructors >-----
        //----------------------------------------------------------------------------------        
        public ActiveMQConsumedQueue(String name) {
            if(String.IsNullOrEmpty(name))
                throw new ArgumentNullException("name");
            fName = name;
        }

        //-----< Public and protected properties >-----
        //----------------------------------------------------------------------------------        

        public String Name {
            get { return fName; }
        }

        public String Selector {
            get;
            set; 
        }

        /// <summary>
        /// Enables or disables exclusive consumers when using queues. An exclusive consumer means
        /// only one instance of a consumer is allowed to process messages on a queue to preserve order
        /// </summary>
        public Boolean IsExclusive {
            get;
            set;
        }

        /// <summary>
        /// Allows you to provide a custom handler for this queue (or topic), in order to consume the raw message,
        /// without the automatic deserialization/dispatching beeing done by SSB.
        /// </summary>
        /// <remarks>This is useful for auditing queues or for consuming text messages that do not conform to xml</remarks>
        public Action<IMessage> Handler { get; set; }

        //-----< Public and protected methods >-----
        //----------------------------------------------------------------------------------        


        //-----< Events >-----
        //----------------------------------------------------------------------------------        


        //-----< Internal members >-----
        //----------------------------------------------------------------------------------        


        //-----< Private members >-----
        //----------------------------------------------------------------------------------        


        //-----< All nested types >-----
        //----------------------------------------------------------------------------------        


        //-----< All explicit interface implementations >-----
        //----------------------------------------------------------------------------------        


    }
}

